#sing SetLocal EnableDelayedExpansion
#newl set outuputname=#path#name-chapters-ogg.txt
#newl IF EXIST "%outuputname%" del "%outuputname%"
#newl set counter=1
#newl FOR /F "usebackq tokens=5,7,* delims=," %%a in ("#item") do (
#newl set starttime=%%a
#newl set starttime=!starttime:~0,-3!
#newl if !var:~2,1!=":" set starttime=0!starttime!
#newl set endtime=%%b
#newl set endtime=!endtime:~0,-3!
#newl set title=%%c
#newl set title=!title:"=!
#newl set title=!title::=,!
#newl echo CHAPTER!counter!=!starttime!
#newl echo CHAPTER!counter!NAME=!title!
#newl set /a counter=!counter!+1
#newl ) >>"%outuputname%"

<comment>
Convert csv file to ogg chapters format.
You can get csv file from 'Parse m4b file, extract chapters info' script.
Remove trailing sexasigmal numbers (.12356 -> .123).
Remove double quotes and colon (replace with ,) from the chapter title.


Ogg chapters format:
CHAPTER01=00:00:00.000
CHAPTER01NAME=Chapter 1
CHAPTER02=00:05:00.000
CHAPTER02NAME=Chapter 2
